

"""
功能描述：维护搜索页面数据
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from common.log import logger

class BasePage:

    def __init__(self,driver):
        self.driver=driver
    def by_find_element(self,*items):
        try:
            element=WebDriverWait(self.driver, 10,0.5).until(lambda x: x.find_element(*items))
            logger.info(f"{items}元素定位成功")
            return element
        except Exception as msg:
            logger.info(f"元素定位失败：{msg}")
            return msg
    def by_find_elements(self,*items):
        try:
            element=WebDriverWait(self.driver, 10,0.5).until(lambda x: x.find_elements(*items))
            logger.info(f"{items}元素定位成功")
            return element
        except Exception as msg:
            logger.info(f"元素定位失败：{msg}")
            return msg



